<?php
declare (strict_types = 1);

namespace app\service;

use app\dao\PaperDao;
use app\model\Paper;
use app\model\BaseModel;
use think\exception\ValidateException;

class PaperService extends \think\Service
{
    protected $paperao;
    public function __construct()
    {
        $this->paperao = new PaperDao();
    }
    public function getPaper(){
        $paper = $this->paperao
            ->getField(['id','name','title'])
            ->getAll();
        return $paper;
    }
    public function intoPaper($data){
        try {
            return $this->paperao->create($data);
        }catch (\Exception $exception) {

        }
    }
    public function deletePaper($id){
            try {
                return $this->paperao->delete($id);
            } catch (\Exception $exception) {

            }
        }
    public function updatePaper($id){
        try {
            return $this->paperao->updateById('status',1, $id);
        }catch (\Exception $exception) {

        }
    }
}
